import {defineStore} from "pinia";
import {SettingState} from "@/store/modulers/setting/types";

export const useSettingStore = defineStore("icesoft-setting", {
    persist: {
        enabled: true,
    },
    state() {
        const state: SettingState = {
            asideWidth: "240px",
            collapse: false,
        };
        return state;
    },
    actions: {
        changeCollapse() {
            this.collapse = !this.collapse;
            this.asideWidth = !this.collapse ? "240px" : "64px";
        },
    },
});
